package com.gking.centerSystem.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gking.centerSystem.common.Result;
import com.gking.centerSystem.entity.AccessIpList;
import com.gking.centerSystem.entity.LogSystemModule;
import com.gking.centerSystem.service.LogSystemModule.LogSystemModuleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/logSystemModule")
public class LogSystemModuleController {

    @Resource
    private LogSystemModuleService logSystemModuleService;


    /**
     * 设置系统模块
     *
     * @param logSystemModule 模块信息
     * @return s
     */
    @PostMapping("/set")
    public Result<String> setLogSystemModule(@RequestBody LogSystemModule logSystemModule) {
        return logSystemModuleService.setLogSystemModule(logSystemModule);
    }


    /**
     * 批量删除
     *
     * @param ids id列表
     * @return s
     */
    @PostMapping("/delete")
    public Result<String> deleteSystemModules(@RequestBody List<String> ids) {
        return logSystemModuleService.deleteSystemModules(ids);
    }

    /**
     * 条件分页查询
     * @param logSystemModule 查询条件
     * @param page 页码
     * @param pageSize 分页大小
     * @return list
     */
    @PostMapping("/get")
    public Result<Page> getLogSystemModule(@RequestBody LogSystemModule logSystemModule,
                                           @RequestParam Integer page, @RequestParam Integer pageSize) {
        return logSystemModuleService.getLogSystemModule(logSystemModule, page, pageSize);
    }


}
